package cn.fl.institution.controller;

import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.ListPageVO;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.*;
import cn.fl.customer.service.ICstNpBscInfoService;
import cn.fl.customer.vo.CstNpBscInfoVO;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.framework.constant.DictionaryConstant;
import cn.fl.project.condition.PrjCstAccInfoQueryCondition;
import cn.fl.project.condition.PrjCstBscInfoQueryCondition;
import cn.fl.project.condition.PrjLinkManQueryCondition;
import cn.fl.project.service.IPrjCstAccInfoService;
import cn.fl.project.service.IPrjCstBscInfoService;
import cn.fl.project.service.IPrjLinkManService;
import cn.fl.project.vo.PrjCstBscInfoVO;
import cn.fl.project.vo.PrjLinkManVO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * @Description: (烟台、淄博）工行信息采集
 */
@RestController
@RequestMapping(value = "/institution/icbcZbOrYt")
public class PrjBscInfoInsIcbcZbAndYtController {

    /**
     * 自然人信息
     */
    @Autowired
    private ICstNpBscInfoService cstNpBscInfoService;

    /**
     * 担保人信息
     */
    @Autowired
    private IPrjCstBscInfoService cstBscInfoService;

    /**
     * 紧急联系人信息
     */
    @Autowired
    private IPrjLinkManService linkManService;

    /**
     * 客户账户信息
     */
    @Autowired
    private IPrjCstAccInfoService cstAccInfoService;

    /**
     * 初始化担保人/紧急联系人列表
     * @param prjId
     * @param cstId
     * @return
     */
    @RequestMapping(value = "/initList.do", method=RequestMethod.GET)
    public Object initList(@RequestParam("prjId") Long prjId, @RequestParam("cstId") Long cstId){
        //查询自然人信息
        BaseLogUtils.newLogger("initLinkManPage.根据cstId获取自然人信息：cstId={}" , cstId).info();
        CstNpBscInfoVO cstNpBscInfoVO = cstNpBscInfoService.selectById(cstId);
        BaseLogUtils.newLogger("initLinkManPage.根据cstId获取自然人信息：==cstNpBscInfoVO={}" , JSON.toJSONString(cstNpBscInfoVO)).info();

        //担保人/紧急联系人信息
        List<PrjLinkManVO> linkManList = new ArrayList<>();

        //紧急联系人
        PrjLinkManQueryCondition link = new PrjLinkManQueryCondition();
        link.setPrjId(prjId);
        BaseLogUtils.newLogger("getLinkManInfo.根据prjId获取紧急联系人信息：linkMan={}" , JSONObject.toJSONString(link)).info();
        List<PrjLinkManVO> linkManVOList = linkManService.searchList(link);
        BaseLogUtils.newLogger("getLinkManInfo.根据prjId获取紧急联系人信息：==prjLinkManVOS={}" , JSON.toJSONString(linkManVOList)).info();
        if(CollectionUtils.isNotEmpty(linkManVOList)){
            for (PrjLinkManVO linkManVO : linkManVOList) {
                    if(StringUtils.isNotEmpty(linkManVO.getRlCd()) && (!(DictionaryConstant.CODE_GRP_RL_TYP_CD_7.equals(linkManVO.getRlCd())) && !(DictionaryConstant.CODE_GRP_RL_TYP_CD_9.equals(linkManVO.getRlCd())))){//“关系”字段值为空的情况下，也做显示

                        //组装返回联系人信息
                        this.setLinkManInfo(linkManList, linkManVO.getId(), linkManVO.getLnkNm(), linkManVO.getMp(), linkManVO.getCertValidEDt(), linkManVO.getRlCd());
                    }

            }
        }
        // 担保人
        PrjCstBscInfoQueryCondition prjCstBscInfoQC = new PrjCstBscInfoQueryCondition();
        prjCstBscInfoQC.setPrjId(prjId);

        BaseLogUtils.newLogger("getPrjCstBscInfo.根据prjId、cstId和客户关系属性获取担保人信息：prjCstBscInfoQC={}" , JSONObject.toJSONString(prjCstBscInfoQC)).info();
        List<PrjCstBscInfoVO> prjCstBscInfoVOS = cstBscInfoService.searchList(prjCstBscInfoQC);
        BaseLogUtils.newLogger("getPrjCstBscInfo.根据prjId、cstId和客户关系属性获取担保人信息：==prjLinkManVOS={}" , JSON.toJSONString(prjCstBscInfoVOS)).info();
        if(CollectionUtils.isNotEmpty(prjCstBscInfoVOS)){

            for (PrjCstBscInfoVO prjCstBscInfoVO : prjCstBscInfoVOS) {
                String mp1 = "";
                if(StringUtils.isNotEmpty(prjCstBscInfoVO.getCstId())) {
                    //查询自然人手机号
                    BaseLogUtils.newLogger("getCstNpBscInfo.根据担保人cstId获取担保人手机号Start：cstId={}", prjCstBscInfoVO.getCstId()).info();
                    CstNpBscInfoVO cstNpBscInfo = cstNpBscInfoService.selectById(prjCstBscInfoVO.getCstId());
                    BaseLogUtils.newLogger("getCstNpBscInfo.根据担保人cstId获取担保人手机号End：cstNpBscInfo={}", JSONObject.toJSONString(cstNpBscInfo)).info();
                    //组装返回担保人信息
                    if (null != cstNpBscInfo) {
                        mp1 = cstNpBscInfo.getMp1();
                    }
                }

                if(StringUtils.isNotEmpty(prjCstBscInfoVO.getRlCd()) && (!(DictionaryConstant.CODE_GRP_RL_TYP_CD_7.equals(prjCstBscInfoVO.getRlCd())) && !(DictionaryConstant.CODE_GRP_RL_TYP_CD_9.equals(prjCstBscInfoVO.getRlCd())))) {//“关系”字段值为空的情况下，也做显示

                    this.setLinkManInfo(linkManList, prjCstBscInfoVO.getId(), prjCstBscInfoVO.getCstNm(), mp1 , prjCstBscInfoVO.getCertValidEDt(), prjCstBscInfoVO.getRlCd());

                }

            }
        }
        ListPageVO<PrjLinkManVO> listPage = new ListPageVO<PrjLinkManVO>(linkManList, linkManList.size());
        return listPage;
    }

    /**
     * 保存资方信息采集 信息
     * @param request
     * @return
     * @throws BaseException
     */
    @RequestMapping(value = "/saveForIcbcZbOrYt.do", method = RequestMethod.POST)
    public DataResultVO saveForIcbcyt(HttpServletRequest request) throws BaseException {

        BaseLogUtils.newLogger("saveForIcbcZbOrYt.修改项目客户账户信息：" + JSON.toJSONString(request.getParameterMap()) + "，操作人：" + CurrentThreadContext.getCurrentUserName()).info();

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();

        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "保存成功");

        try{

            //担保人与联系人信息
            String linkManList = request.getParameter("linkManList");//担保人与联系人

            if(StringUtils.isEmpty(linkManList)){

                return new DataResultVO(BaseConstant.IS_YESNO_NO,"请维护担保人/紧急联系人信息!");

            }

            List<PrjLinkManVO>  linkManVOS = JSON.parseArray(linkManList, PrjLinkManVO.class);

            //组装请求参数
            resultVO = this.packrjCstAccInfo(prjCstAccInfoQC,request);

            if(null != resultVO){

                return resultVO;

            }

            //保存自然人信息
            this.modifyCstNpBscInfo(prjCstAccInfoQC);

            //保存担保人/紧急联系人信息
            this.modifyCstLinkManAndCstBscInfo(prjCstAccInfoQC,linkManVOS);

            //保存客户账户信息
            resultVO = this.modifyCstAccInfo(prjCstAccInfoQC);

            //四要素校验
            if(resultVO.getSuccess() == BaseConstant.IS_YESNO_NO) {
                resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
                resultVO.setInfo(resultVO.getInfo());
            }

            if (BaseConstant.IS_YESNO_YES == resultVO.getSuccess()) {

                Map<String,String> resultMap = (Map<String, String>) resultVO.getData();
                String chkRstCd = resultMap.get("chkRstCd");
                String rstDesc = resultMap.get("rstDesc");
                String bankCardType = resultMap.get("bankCardType");
                //四要素结果
                if (!BaseConstant.IS_YESNO_YES_STR.equals(chkRstCd)) {
                    resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
                    resultVO.setInfo(rstDesc);
                    return resultVO;
                }
                //银行卡类型
                if (!BaseConstant.IS_YESNO_NO_STR.equals(bankCardType)) {
                    resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
                    resultVO.setInfo("不支持此类银行卡，请更换为借记卡");
                    return resultVO;
                }
            }
        }catch (BaseException ex) {
            resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
            resultVO.setInfo(ex.getMessage());
            BaseLogUtils.newLogger("saveForIcbczb.保存项目客户账户信息及校验,prjId:" + prjCstAccInfoQC.getPrjId() + ".ERROR:" + ex.getMessage()).info();
        } catch (Exception e) {
            BaseLogUtils.newLogger("saveForIcbczb.保存失败，系统异常" + e).info();
            return new DataResultVO(BaseConstant.IS_YESNO_NO, "保存失败，系统异常");
        }

        BaseLogUtils.newLogger("saveForCcbank.保存项目客户账户信息及校验返回dataResultVO=" + JSON.toJSONString(resultVO)).info();
        return resultVO;
    }

    /**
     * 组装请求参数
     * @param prjCstAccInfoQC
     * @param request
     * @return
     */
    private DataResultVO packrjCstAccInfo(PrjCstAccInfoQueryCondition prjCstAccInfoQC,HttpServletRequest request){

        try{

            //项目客户信息表id
            String cstAccInfoId = request.getParameter("cstAccInfoId");
            //项目id
            String prjId = request.getParameter("prjId");
            //客户id
            String cstId = request.getParameter("cstId");
            //客户名称
            String cstNm = request.getParameter("cstNm");
            //机构code
            String insCode = request.getParameter("insCode");
            //机构名称
            String insId = request.getParameter("insId");

            //身份证信息
            String cstFnm = request.getParameter("cstFnm");//姓

            String cstLnm = request.getParameter("cstLnm");//名

            String cstPyFnm = request.getParameter("cstPyFnm"); //拼音姓

            String cstPyLnm = request.getParameter("cstPyLnm");//拼音名

            String lssueOffice = request.getParameter("lssueOffice"); //身份证签发机关

            String certTypCd = request.getParameter("certTypCd"); //证件类型

            String certNo = request.getParameter("certNo"); //证件号码

            String postAddr = request.getParameter("postAddr");//身份证地址

            String postProvince = request.getParameter("postProvince");//现居住地省

            String postCity = request.getParameter("postCity");//现居住地市

            String postCounty = request.getParameter("postCounty");//现居住地县

            //资产信息
            String accNo = request.getParameter("accNo"); //银行账号

            String mp = request.getParameter("mp");//银行预留手机号

            String monthInc = request.getParameter("monthInc"); //月收入(元)

            String tolPsonlAst = request.getParameter("tolPsonlAst");//个人总资产(万)

            String rsidOcpyDt = request.getParameter("rsidOcpyDt");//住宅入住日期

            String othDebTbal = request.getParameter("othDebTbal");//累计负债余额（万）

            String monRepayAmt = request.getParameter("monRepayAmt");//累计负债月还（元）

            if(StringUtils.isNotEmpty(cstAccInfoId)) {
                prjCstAccInfoQC.setId(Long.valueOf(cstAccInfoId));
            }

            if(StringUtils.isNotEmpty(prjId)) {
                prjCstAccInfoQC.setPrjId(Long.valueOf(prjId));
            }

            if(StringUtils.isNotEmpty(cstId)) {
                prjCstAccInfoQC.setCstId(Long.valueOf(cstId));
            }

            prjCstAccInfoQC.setCstNm(cstNm);
            prjCstAccInfoQC.setInsCode(insCode);
            prjCstAccInfoQC.setCertNo(certNo);
            prjCstAccInfoQC.setCertTypCd(certTypCd);
            prjCstAccInfoQC.setCstFnm(cstFnm);
            prjCstAccInfoQC.setCstPyFnm(cstPyFnm);
            prjCstAccInfoQC.setCstLnm(cstLnm);
            prjCstAccInfoQC.setCstPyLnm(cstPyLnm);
            prjCstAccInfoQC.setLssueOffice(lssueOffice);
            prjCstAccInfoQC.setPostAddr(postAddr);
            prjCstAccInfoQC.setPostProvince(postProvince);
            prjCstAccInfoQC.setPostCity(postCity);
            prjCstAccInfoQC.setPostCounty(postCounty);
            prjCstAccInfoQC.setAccNo(accNo);
            prjCstAccInfoQC.setMp(mp);
            prjCstAccInfoQC.setMonthInc(monthInc);

            if(StringUtils.isNotEmpty(tolPsonlAst)) {
                prjCstAccInfoQC.setTolPsonlAst(Double.valueOf(tolPsonlAst).longValue());
            }

            if(StringUtils.isNotEmpty(rsidOcpyDt)) {
                prjCstAccInfoQC.setRsidOcpyDt(DateUtils.formatStringToDate(rsidOcpyDt, DateUtils.YYYY_MM_DD));
            }

            if(StringUtils.isNotEmpty(othDebTbal)) {
                prjCstAccInfoQC.setOthDebTbal(Double.valueOf(othDebTbal).longValue());
            }

            if(StringUtils.isNotEmpty(monRepayAmt)) {
                prjCstAccInfoQC.setMonRepayAmt(Double.valueOf(monRepayAmt).longValue());
            }

        }catch (BaseException ex) {
            BaseLogUtils.newLogger("packPrjCstAccInfo.组装前台请求参数异常:" + JSONObject.toJSONString(prjCstAccInfoQC)+ ".ERROR:" + ex.getMessage()).info();
            return new DataResultVO(BaseConstant.IS_YESNO_NO, "参数请求异常!");
        }
        return null;
    }


    /**
     * 保存担保人/紧急联系人信息
     * @param prjCstAccInfoQC
     */
    private void modifyCstLinkManAndCstBscInfo(PrjCstAccInfoQueryCondition prjCstAccInfoQC, List<PrjLinkManVO> linkManVOS) throws BaseException {

            //修改 担保人/紧急联系人 身份证到期日
            for (PrjLinkManVO  prjLinkManVO : linkManVOS) {
                //查询是否是担保人
                PrjCstBscInfoQueryCondition  prjCstBscInfoQC = new PrjCstBscInfoQueryCondition();
                prjCstBscInfoQC.setPrjId(prjCstAccInfoQC.getPrjId());
                prjCstBscInfoQC.setId(prjLinkManVO.getId());
                prjCstBscInfoQC.setRlCd(prjLinkManVO.getRlCd());//客户关系属性 -担保人

                BaseLogUtils.newLogger("modifyCstLinkManAndCstBscInfo.根据prjId、cstId和客户关系属性获取担保人信息：prjCstBscInfoQC={}" , JSONObject.toJSONString(prjCstBscInfoQC)).info();
                List<PrjCstBscInfoVO> prjCstBscInfoVOS = this.cstBscInfoService.searchList(prjCstBscInfoQC);
                BaseLogUtils.newLogger("modifyCstLinkManAndCstBscInfo.根据prjId、cstId和客户关系属性获取担保人信息：prjCstBscInfoVOS={}" , JSON.toJSONString(prjCstBscInfoVOS)).info();
                if(CollectionUtils.isNotEmpty(prjCstBscInfoVOS)){

                    PrjCstBscInfoVO prjCstBscInfoVO = prjCstBscInfoVOS.get(0);

                    if(!Objects.equals(prjCstBscInfoVO.getCertValidEDt(), prjLinkManVO.getCertValidEDt())){
                        prjCstBscInfoVO.setCertValidEDt( prjLinkManVO.getCertValidEDt());//身份证到期日
                    }

                    this.cstBscInfoService.modify(prjCstBscInfoVO);

                }else{

                    PrjLinkManQueryCondition link = new PrjLinkManQueryCondition();
                    link.setPrjId(prjCstAccInfoQC.getPrjId());
                    link.setId(prjLinkManVO.getId());
                    link.setRlCd(prjLinkManVO.getRlCd());//客户关系属性 -联系人
                    link.setMp(prjLinkManVO.getMp());//客户关系属性 -手机号
                    BaseLogUtils.newLogger("modifyCstLinkManAndCstBscInfo.根据id获取紧急联系人信息：linkMan={}" , JSONObject.toJSONString(link)).info();
                    List<PrjLinkManVO> linkManVOList = this.linkManService.searchList(link);
                    BaseLogUtils.newLogger("modifyCstLinkManAndCstBscInfo.根据prjId获取紧急联系人信息：prjLinkManVOS={}" , JSON.toJSONString(linkManVOList)).info();

                    if(CollectionUtils.isNotEmpty(linkManVOList)){

                        PrjLinkManVO linkManVO = linkManVOList.get(0);

                        if(!Objects.equals(linkManVO.getCertValidEDt(), prjLinkManVO.getCertValidEDt())){
                            linkManVO.setCertValidEDt(prjLinkManVO.getCertValidEDt());//身份证到期日
                        }

                        linkManService.modify(linkManVO);

                    }
                }

            }

    }

    /**
     * 保存客户账户信息
     * @param prjCstAccInfoQC
     * @return
     */
    private DataResultVO modifyCstAccInfo(PrjCstAccInfoQueryCondition prjCstAccInfoQC) throws BaseException{

        // 修改项目客户信息
        PrjCstAccInfoQueryCondition condition = new PrjCstAccInfoQueryCondition();

        if (StringUtils.isNotEmpty(prjCstAccInfoQC.getId())) {
            condition.setId(prjCstAccInfoQC.getId());
        }

        condition.setBkCd(prjCstAccInfoQC.getBkCd());//银行代码
        condition.setBkNo(prjCstAccInfoQC.getBkCd());//数据库bkCd即bkNo
        condition.setBkNm(prjCstAccInfoQC.getBkNm());//银行名称
        condition.setPrjId(prjCstAccInfoQC.getPrjId());//项目id
        condition.setCstId(prjCstAccInfoQC.getCstId());//客户id
        condition.setInsCode(prjCstAccInfoQC.getInsCode());//机构code
        condition.setCstFnm(prjCstAccInfoQC.getCstFnm());//姓
        condition.setCstLnm(prjCstAccInfoQC.getCstLnm());//名
        condition.setCstPyFnm(prjCstAccInfoQC.getCstPyFnm());//拼音姓
        condition.setCstPyLnm(prjCstAccInfoQC.getCstPyLnm());//拼音名
        condition.setLssueOffice(prjCstAccInfoQC.getLssueOffice());//身份证签发机关
        condition.setAccNo(prjCstAccInfoQC.getAccNo());//银行账号
        condition.setMp(prjCstAccInfoQC.getMp());//银行预留手机号
        // 个人总资产 万元转元  元转分
        Long tolPsonlAst = DecimalUtils.convertYuanToFen(DecimalUtils.mul(Double.valueOf(prjCstAccInfoQC.getTolPsonlAst()), 10000));

        //累计负债余额  万元转元  元转分
        Long othDebTbal = DecimalUtils.convertYuanToFen(DecimalUtils.mul(Double.valueOf(prjCstAccInfoQC.getOthDebTbal()), 10000));

        //累计月还余额
        Long monRepayAmt = DecimalUtils.convertYuanToFen(Double.valueOf(prjCstAccInfoQC.getMonRepayAmt()));


        condition.setTolPsonlAst(tolPsonlAst);
        condition.setOthDebTbal(othDebTbal);
        condition.setMonRepayAmt(monRepayAmt);
        condition.setRsidOcpyDt(prjCstAccInfoQC.getRsidOcpyDt());//住宅入住日期
        condition.setCertNo(prjCstAccInfoQC.getCertNo());//证件号码
        condition.setCertTypCd(prjCstAccInfoQC.getCertTypCd());//证件类型
        BaseLogUtils.newLogger("modifyPrjAccInfoInfo.根据id区分保存修改项目客户信息信息：prjCstAccInfoQC={}" , JSONObject.toJSONString(prjCstAccInfoQC)).info();
        DataResultVO dataResultVO = this.cstAccInfoService.modifyPrjAccInfo(condition);
        BaseLogUtils.newLogger("modifyCstLinkManAndCstBscInfo.项目客户信息保存或修改成功：dataResultVO={}" , JSON.toJSONString(dataResultVO)).info();
        return dataResultVO;
    }

    /**
     * 修改自然人信息
     * @param prjCstAccInfoQC 客户账户信息
     * @return
     */
    private void modifyCstNpBscInfo(PrjCstAccInfoQueryCondition prjCstAccInfoQC) throws BaseException {

        //根据客户id查询 客户信息
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjCstAccInfoQC.getCstId());

        if(null != cstNpBscInfoVO){
            //修改标识
            boolean flag = false;
            CstNpBscInfoVO npBscInfoVO = new CstNpBscInfoVO();
            npBscInfoVO.setId(cstNpBscInfoVO.getId());

            //身份证签发机关
            if(!Objects.equals(prjCstAccInfoQC.getLssueOffice(),cstNpBscInfoVO.getIssuingOrg())){

                npBscInfoVO.setIssuingOrg(prjCstAccInfoQC.getLssueOffice());
                flag = true;

            }
            //身份证地址
            if(!Objects.equals(prjCstAccInfoQC.getPostAddr(),cstNpBscInfoVO.getPostAddr())){

                npBscInfoVO.setPostAddr(prjCstAccInfoQC.getPostAddr());
                flag = true;

            }

            //通讯地址-省
            if(!Objects.equals(prjCstAccInfoQC.getPostProvince(),cstNpBscInfoVO.getPostProvince())){

                npBscInfoVO.setPostProvince(prjCstAccInfoQC.getPostProvince());
                flag = true;

            }

            //通讯地址-市
            if(!Objects.equals(prjCstAccInfoQC.getPostCity(),cstNpBscInfoVO.getPostCity())){

                npBscInfoVO.setPostCity(prjCstAccInfoQC.getPostCity());
                flag = true;

            }

            //通讯地址-县
            if(!Objects.equals(prjCstAccInfoQC.getPostCounty(),cstNpBscInfoVO.getPostCounty())){

                npBscInfoVO.setPostCounty(prjCstAccInfoQC.getPostCounty());
                flag = true;

            }

            //有信息变更 更新变更时间和变更人
            if(flag){

                npBscInfoVO.setMdfTm(new Date());//更新时间
                npBscInfoVO.setMdfUsrId(CurrentThreadContext.getCurrentUserId());//更新人

            }

            BaseLogUtils.newLogger("modifyCstNpBscInfo.淄博工行修改自然人信息npBscInfoVO" + JSON.toJSONString(cstNpBscInfoVO)).info();
            boolean modify = this.cstNpBscInfoService.modify(npBscInfoVO);
            BaseLogUtils.newLogger("modifyCstNpBscInfo.淄博工行修改自然人信息modify=" + modify).info();
        }

    }

    /**
     * 返回担保人联系人信息
     * @param prjLinkManVOS
     * @param cstNm
     * @param mp
     * @param certValidEDt
     * @param cstRlCd
     */
    private void setLinkManInfo( List<PrjLinkManVO> prjLinkManVOS ,Long id,String cstNm, String mp, String certValidEDt, String cstRlCd) {
        PrjLinkManVO prjLinkManVO  = new PrjLinkManVO();
        prjLinkManVO.setId(id);
        prjLinkManVO.setLnkNm(cstNm);//客户名称 (担保人名称)
        prjLinkManVO.setMp(mp);//手机号 取自然人手机号
        prjLinkManVO.setCertValidEDt(certValidEDt);//身份证到期日
        //prjLinkManVO.setCertValidEDt("2020-04-25");//身份证到期日
        if("长期".equals(certValidEDt)){
            prjLinkManVO.setCertValidCheckEDt(Boolean.TRUE);//身份证到期日 是否长期
        }
        prjLinkManVO.setRlCd(cstRlCd);//客户关系
        prjLinkManVOS.add(prjLinkManVO);
    }


}
